﻿using System;

namespace OGS.Contracts
{
    /// <summary>
    /// Search class
    /// </summary>
    [Serializable]
    public class SearchAttributes
    {
        #region Private variables

        private char _filterCharacter;
        private int _sortColumnIndex;
        private SortDirection _sortDirection;
        private int _currentPageNumber;
        private int _recordsPerPage;
        private int _totalRecordCount;
        private string _searchText;
        private int _proveder_Type;

        #endregion Private variables

        #region Constructor

        /// <summary>
        /// Default Search constructor
        /// </summary>
        public SearchAttributes()
        {
            this._sortDirection = SortDirection.Ascending;
            this._filterCharacter = (char)32;
        }

        /// <summary>
        /// Paramterized Search constructor
        /// </summary>
        public SearchAttributes(char _filterCharacter, int _sortColumnIndex
                      , SortDirection _sortDirection, int _currentPageNumber
                      , int _recordsPerPage, string _searchText, int _proveder_Type)
        {
            this._sortDirection = _sortDirection;
            this._filterCharacter = _filterCharacter;
            this._sortColumnIndex = _sortColumnIndex;
            this._currentPageNumber = _currentPageNumber;
            this._recordsPerPage = _recordsPerPage;
            this._searchText = _searchText;
            this._proveder_Type = _proveder_Type;
        }

        #endregion Constructor(s)

        #region Properties

        #region Sort Column Index
        /// <summary>
        /// Column Index to Sort
        /// </summary>
        public int SortColumnIndex
        {
            get
            {
                return _sortColumnIndex;
            }
            set
            {
                _sortColumnIndex = value;
            }
        }
        #endregion Sort Column Index

        #region Sort Direction
        /// <summary>
        /// Sort Direction of Sort Column
        /// </summary>
        public SortDirection SortDirection
        {
            get
            {
                return _sortDirection;
            }
            set
            {
                _sortDirection = value;
            }
        }
        #endregion Sort Direction

        #region Current Page Number
        /// <summary>
        /// Current Page Number
        /// </summary>
        public int CurrentPageNumber
        {
            get
            {
                return _currentPageNumber;
            }
            set
            {
                _currentPageNumber = value;
            }
        }
        public int Provider_Type
        {
            get
            {
                return _proveder_Type;
            }
            set
            {
                _proveder_Type = value;
            }
        }
        #endregion Current Page Number

        #region Records Per Page
        /// <summary>
        /// No of records to return
        /// </summary>
        public int RecordsPerPage
        {
            get
            {
                return _recordsPerPage;
            }
            set
            {
                _recordsPerPage = value;
            }
        }
        #endregion Records Per Page

        #region Filter Character
        /// <summary>
        /// Alphabetic Filter Character
        /// </summary>
        public char FilterCharacter
        {
            get
            {
                return _filterCharacter;
            }
            set
            {
                _filterCharacter = value;
            }
        }
        #endregion Filter Character

        #region TotalRecordCount
        /// <summary>
        /// Total Records returned by results
        /// </summary>
        public int TotalRecordCount
        {
            get
            {
                return _totalRecordCount;
            }
            set
            {
                _totalRecordCount = value;
            }
        }
        #endregion TotalRecordCount

        #region Search Text
        /// <summary>
        /// Search Text
        /// </summary>
        public string SearchText
        {
            get
            {
                return _searchText;
            }
            set
            {
                _searchText = value;
            }
        }
        #endregion Search Text

        #endregion Properties

    }

    public enum SortDirection : short
    {
        Ascending = 0,
        Descending = 1
    }
}
